// 1.引入
import Vue from 'vue'
import VueRouter from 'vue-router'
import HuBaY from '@/views/HuBaY.vue'
import WangPZi from '@/views/WangPZi.vue'
import DaJinY from '@/views/DaJinY.vue'
import JinJue from '@/views/JinJue.vue'
import LongLin from '@/views/LongLin.vue'
import YunNan from '@/views/YunNan.vue'
import MoJin from '@/views/MoJin.vue'
// 2.在vue中，使用使用vue的插件，都需要调用Vue.use()
Vue.use(VueRouter)
// 3.创建路由实例
const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/find',
    },
    {
      path: '/find',
      component: HuBaY,
      children: [
        {
          path: 'recom',
          component: JinJue,
        },
        {
          path: 'rank',
          component: LongLin,
        },
        {
          path: 'songlist',
          component: YunNan,
        },
      ],
    },
    {
      path: '/my',
      component: WangPZi,
    },
    {
      path: '/part',
      component: DaJinY,
    },
    {
      path: '/txt',
      component: MoJin,
    },
  ],
})
//暴露router
export default router
